const decodeQuery = function() {
  let search = decodeURI(document.location.search);
  return search
    .replace(/(^\?)/, '')
    .split('&')
    .reduce(function(result, item) {
      let values = item.split('=');
      result[values[0]] = values[1];
      return result;
    }, {});
};

export { decodeQuery };
